<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@ include file="/WEB-INF/jsp/common/taglib.jsp"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Ajax</title>
<script>
	var contextPath = "<c:url value='/' />";
</script>

<script src="<c:url value="/ui/jquery-1.10.2.js" />"></script>
<script src="<c:url value="/ui/jquery-migrate-1.2.1.js" />"></script>

<link rel="stylesheet" href="<c:url value="/demo/jquery.ui.all.css"/>">
<link href="<s:url value="/css/standard.css" />" rel="stylesheet"
	type="text/css" />
<link href="<s:url value="/css/pop_up.css" />" rel="stylesheet"
	type="text/css" />
<link href="<s:url value="/css/maintenance.css" />" rel="stylesheet"
	type="text/css" />
<link href="<s:url value="/css/Simplemodal.css" />" rel="stylesheet"
	type="text/css" />

<script src='<c:url value="/js/jquery.DynamicMessage.js" />'></script>
<script src='<c:url value="/js/jquery.simplemodal-1.4.1.js" />'></script>

<script src='<c:url value="/js/common.js" />'></script>
<script src='<c:url value="/js/common_ui.js" />'></script>
<script src='<c:url value="/js/poplayer.js" />'></script>
<script src='<c:url value="/js/maint_ui.js" />'></script>
<script src='<c:url value="/js/jquery.form.js" />'></script>


<script src="<c:url value="/ui/jquery.ui.core.js" />"></script>
<script src="<c:url value="/ui/jquery.ui.widget.js" />"></script>
<script src="<c:url value="/ui/jquery.ui.datepicker.js" />"></script>
<!--  <script src="<c:url value="/ui/jquery-ui-timepicker-addon.js" />"></script>-->

<script src='<c:url value="/js/jquery.simplemodal-1.4.1.js" />'></script>

<script src="<c:url value="/ui/exporting.js" />"></script>
<script src="<c:url value="/ui/exporting.src.js" />"></script>
<script src="<c:url value="/ui/highcharts.js" />"></script>
<script src="<c:url value="/ui/highcharts.src.js" />"></script>
<script src="<c:url value="/ui/highcharts-3d.js" />"></script>
<script src="<c:url value="/ui/highcharts-3d.src.js" />"></script>

<script src="<c:url value="/ui/jquery-ui-slide.min.js" />"></script>
<link rel="stylesheet" href="<c:url value="/demo/demos.css" />">
<link rel="stylesheet" href="<c:url value="/demo/dateTime.css" />">
</head>
<body>
	<form:form id="formAjax" name="formAjax" method="post">
		<input name="name" type="text">
		<input name="sex" type="text">
		<input name="submit" type="submit" id="submit">
	</form:form>
	<p name="AjaxText" id="AjaxText"></p>
	<p name="requestAjax" id="requestAjax"></p>

	<div id="pie" style="width: 400px;"></div>
	<script type="text/javascript">
		var year = $("#year").val();
		var mon = $("mon").val();
		var test = {
			"year" : year,
			"mon" : mon
		};

		$("#submit").click(
				function() {
					$("#formAjax").attr("action",
							"<c:url value='/productsales_reports/formAjax' />")

					$("#formAjax").ajaxSubmit({
						dataType : 'json',
						success : function(meg) {
							$("#AjaxText").text(meg.name);
						}
					});
					return false;
				});

		$(function() {
			$.ajax({
				url : "<c:url value='/productsales_reports/requestAjax'/>",
				async : false,
				data : {},

				success : function(mes) {
					var hal = mes.eval('(' + mes + ')');
					$('#requestAjax').text(hal.year);
				},
				type : "POST"
			})
		})
	</script>

</body>
</html>